package com.swak.algs.array;

public class Swaps {

	public static void swap(int arr[], int i, int n) {
		if (i == n) {
			return;
		}
		arr[i] = arr[i] ^ arr[n];
		arr[n] = arr[i] ^ arr[n];
		arr[i] = arr[i] ^ arr[n];
	}

	public static void oldSwap(int arr[], int i, int n) {
		if (i == n) {
			return;
		}
		int temp = arr[i];
		arr[i] = arr[n];
		arr[n] = temp;
	}
}
